package movee.clickhouse.client.dao;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Table;
import java.io.Serializable;
import java.sql.Timestamp;

/**
 *
 *
 * @author movee
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
@IdClass(value = ClusterId.class)
@Entity
@Table(name = "cluster")
public class ClusterDao implements Serializable {

    @Id
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Timestamp timestamp;
    @Id
    private String idc;
    @Id
    private String cluster;
    private Integer loss;
    private Integer total;
    private Double availability;
    @Column(name = "fixed_availability")
    private Double fixedAvailability;
    @Column(name = "map_availability")
    private Double mapAvailability;
    @Column(name = "create_at")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Timestamp createAt;
    @Column(name = "mean_normal_availability")
    private Double meanNormalAvailability;

}
